<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>H+ 后台主题UI框架 - 表单验证 jQuery Validation</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__ADMIN__css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__ADMIN__css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__ADMIN__css/animate.min.css" rel="stylesheet">
    <link href="__ADMIN__css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="__ADMIN__css/plugins/switchery/switchery.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>管理员信息修改</h5>
                </div>
                <div class="ibox-content">
                    <form action="{:U('admin/save')}" method="post" class="form-horizontal m-t" id="Form" enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">账号：</label>
                            <div class="col-sm-8">
                                <input id="username" name="username" class="form-control" type="text" value="{$adminInfo.username}" readonly>
                                <input type="hidden" name="id" value="{$adminInfo.id}">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 不能包含特殊字符</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">真实姓名：</label>
                            <div class="col-sm-8">
                                <input id="realName" name="realName" class="form-control" type="text" aria-required="true" aria-invalid="false" class="valid" value="{$adminInfo.realname}">
                                <input type="hidden" id="id" value="{$adminInfo.id}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分组：</label>
                            <div class="col-sm-8">
                                <select class="form-control m-b" name="title">v
                                    <option>==请选择角色==</option>
                                    <foreach name="list" item="vo" >
                                        <option value ="{$vo.id}" <if condition="$vo['id'] == $adminInfo['group_id']">selected</if>>{$vo.title}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                                <button class="btn btn-defualt" type="reset" onclick="history.go(-1)">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__ADMIN__js/jquery.min.js?v=2.1.4"></script>
<script src="__ADMIN__js/bootstrap.min.js?v=3.3.6"></script>
<script src="__ADMIN__js/content.min.js?v=1.0.0"></script>
<script src="__ADMIN__js/plugins/validate/jquery.validate.min.js"></script>
<script src="__ADMIN__js/plugins/validate/messages_zh.min.js"></script>
<script src="__ADMIN__js/jquery.form.js"></script>
<script src="__ADMIN__js/plugins/layer/layer.min.js"></script>
<script src="__ADMIN__js/plugins/validate/messages_zh.min.js"></script>
<script src="__ADMIN__js/plugins/switchery/switchery.js"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script>
    $(document).ready(function(){
        $.validator.addMethod('checkName',function(value, element, param){
            if(/^[a-zA-Z0-9_-]{3,16}$/.test(value)) {
                return true;
            }else{
                return false;
            }
        },"");
        $('#Form').validate({
            rules: {
                username: {
                    required: true,
                    minlength: 3,
                    checkName:true
                },
                realName: {
                    required: true,
                }
            },
            messages: {
                username: {
                    required: "请输入用户名",
                    minlength: "用户名必需由两个字母组成",
                    checkName:"不能包含特殊字符"
                },
                realName: "请输入真实姓名"
            },
            submitHandler:function(form){
                var form = new FormData(document.getElementById('Form'));
                $.ajax({
                    url:"{:U('admin/save')}",
                    type:'post',
                    dataType:'json',
                    data:form,
                    cache:false,
                    processData:false,
                    contentType:false,
                    success:function(data){
                        if(data.status > 0){
                            layer.msg(data.msg, {icon: 6,time: 1000}, function(){
                                window.location.href="{:U('admin/index')}";
                            });
                        }else{
                            layer.msg(data.msg, {icon: 5,time: 1000},function(){
                                window.location.href="{:U('admin/edit')}";
                            });
                        }
                    }
                });
            }
        });
        var elem = document.querySelector('.js-switch');
        var switchery = new Switchery(elem, { });
    })
</script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:16 GMT -->
</html>
